using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WorkFlowCore.BusinessDemo.Web.Entities
{
    public class Organization
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [MaxLength(100)]
        public string Name { get; set; }

        [MaxLength(500)]
        public string Description { get; set; }

        public int? ParentId { get; set; }

        [ForeignKey("ParentId")]
        public virtual Organization Parent { get; set; }

        public virtual ICollection<Organization> Children { get; set; }

        public DateTime CreatedTime { get; set; } = DateTime.Now;
        
        public DateTime UpdatedTime { get; set; } = DateTime.Now;
    }
}
